package com.jbl.gof23.structure.adapter;

public class Computer {

    public void net(AdapterUSB adapterUSB){
        //寻找适配类
        adapterUSB.handleRequest();
    }

    /**
     * 测试
     */
    public static void main(String[] args) {
        //继承式
        new Computer().net(new AdapterUSBImpl());
        //组合式
        Computer computer = new Computer();
        WangXian wangXian = new WangXian();
        AdapterUSBImpl2 adapterUSBImpl2 = new AdapterUSBImpl2(wangXian);
        computer.net(adapterUSBImpl2);
    }
}
